package com.njiandan.laosijivideo;

import android.content.Intent;
import android.os.Bundle;

import com.njiandan.laosijivideo.plugin.QrScanPlugin;

import io.flutter.app.FlutterActivity;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
    private static final String CHANNEL = "com.njiandan.laosijivideo/video";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        GeneratedPluginRegistrant.registerWith(this);
        QrScanPlugin.registerWith(this.registrarFor("com.njiandan.laosijivideo.QrScanPlugin"));

//        new MethodChannel(getFlutterView(), CHANNEL).setMethodCallHandler(
//                new MethodChannel.MethodCallHandler() {
//                    @Override
//                    public void onMethodCall(MethodCall call, MethodChannel.Result result) {
//                        switch (call.method) {
//                            case "openWebviewVideo": {
//                                String videoUrl = call.argument("videoUrl");
//                                String videoTitle = call.argument("videoTitle");
//                                String webviewUrl = call.argument("webviewUrl");
//                                Intent intent = new Intent(MainActivity.this, WebDetailActivity.class);
//                                intent.putExtra(WebDetailActivity.VIDEO_URL, videoUrl);
//                                intent.putExtra(WebDetailActivity.VIDEO_WEBVIEW_URL, webviewUrl);
//                                intent.putExtra(WebDetailActivity.VIDEO_TITLE, videoTitle);
//                                startActivity(intent);
//
//                                result.success("");
//                                break;
//                            }
//                            default:
//                                result.notImplemented();
//                                break;
//                        }
//                    }
//                });
    }
}

